package org.jeecg.modules.basedata.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.entity.basedata.BaseFloor;
import org.jeecg.vo.basedata.BaseFloorPage;

import java.util.List;

/**
 * @Description: 楼宇
 * @Author: jeecg-boot
 * @Date:   2019-07-02
 * @Version: V1.0
 */
public interface BaseFloorMapper extends BaseMapper<BaseFloor> {
    public BaseFloorPage selectByMainId(String mainId);

    List<BaseFloorPage> getBaseFloorPage(Page<BaseFloorPage> page, @Param("ew") Wrapper<BaseFloorPage> queryWrapper);

    public  List<BaseFloor> queryFloorList(@Param("projectId") String projectId);

    List<BaseFloorPage> listByParams(@Param("page") Page<BaseFloorPage> page, @Param("map")BaseFloorPage baseFloor);

    public  Integer getRoomCount(String id);

    public Integer getRoomCounts(@Param("ids") String[] ids);

    @Select("select * from base_floor where project_id =#{projectId} AND name = #{floorName} and del_flag='0'")
    BaseFloor queryFloorName(@Param("projectId") String projectId,@Param("floorName") String floorName);
    @Select("select name from base_project where id =#{projectId}")
    String queryProjectName(@Param("projectId") String projectId);

    BaseFloor getByProjectIdName(@Param("projectId") String projectId, @Param("name") String name);
}
